//
// Interface of a class to access data (virtual file system)
//

#ifndef	__FILE_SYSTEM__
#define	__FILE_SYSTEM__

class Data;

bool		fileExist ( const char * fileName );// simple check whether the file exists
std::string		getPath ( const std::string& fullName );// extract path from a filename
std::string		getFileName ( const std::string& fullName );// extract filename and extension
std::string		getName ( const std::string& fullName );// get only name without extension
std::string		buildFileName ( const std::string& path, const std::string& file );// build filename from path and a name

class	FileSystem
{
public:
	FileSystem () {}
	virtual ~FileSystem () {}

	virtual	bool	isOk () const
	{
		return false;
	}

	virtual	Data  * getFile  ( const std::string& name ) = 0;
};

class	Folder : public FileSystem
{
	std::string	folder;

public:
	Folder ( const std::string& theFolder );

	virtual	bool	isOk () const
	{
		return true;
	}

	virtual	Data  * getFile  ( const std::string& name );
};

// get file contents (possibly scanning several sources)
Data * 		getFile ( const char * fileName );

#endif
